﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using ProjectStudy.App_Code;
using System.Data;
using Newtonsoft.Json;
namespace ProjectStudy.Ajax
{
    /// <summary>
    /// Ajax_GetMenu 的摘要说明
    /// </summary>
    public class Ajax_GetMenu : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string sql = "select * from Menu where userGroup=@group";
            string s = context.Session["group"].ConvertObjToStr();
            SqlParameter ps = new SqlParameter("@group", SysSession.UserGroup.ConvertObjToStr());
            DataTable dt = DBAccess.ExecuteDataTable(sql, ps);
            context.Response.Write(JsonConvert.SerializeObject(dt));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}